package cn.shopping.service.impl.members;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.shopping.dao.members.membersMapper;
import cn.shopping.pojo.Au_user;
import cn.shopping.pojo.hat_area;
import cn.shopping.pojo.hat_caty;
import cn.shopping.pojo.hat_province;
import cn.shopping.pojo.hat_total;
import cn.shopping.service.members.membersService;

@Service
public class membersServiceimpl implements membersService{

	@Autowired
	private membersMapper membersmapper;

	@Override
	public List<hat_province> getprovince() {
		return membersmapper.selprovince();
	}

	@Override
	public List<hat_caty> getcity( String num ) {
		return membersmapper.selcity(num);
	}

	@Override
	public List<hat_area> getarea( String num ) {
		return membersmapper.selarea(num);
	}

	@Override
	public boolean addtotle(hat_total totle) {
		boolean flag = false;
		if(membersmapper.addtotal(totle)>0){
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean addmember(Au_user user) {
		boolean flag = false;
		if(membersmapper.addmembers(user)>0){
			flag=true;
		}
		return flag;
	}

	@Override
	public int seltotlemax() {
		
		return membersmapper.seltotlemax();
	}

	@Override
	public boolean deltotle(int hat_id) {
		boolean flag = false;
		if (membersmapper.deltotle(hat_id)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public List<Au_user> getalluser(String idcode,String memName) {
		return membersmapper.selalluser(idcode,memName);
	}

	@Override
	public boolean delofuserbyid(Integer userid) {
		boolean flag = false;
		if (membersmapper.delofuser(userid)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public Au_user getserbyid(Integer userId) {
		return membersmapper.selserbyid(userId);
	}

	@Override
	public boolean modifytotal(hat_total total) {
		boolean flag = false;
		if (membersmapper.modifytotal(total)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean mmodifyuserbtid(Au_user user) {
		boolean flag = false;
		if (membersmapper.modifyusersByid(user)>0) {
			flag=true;
		}
		return flag;
	}
	

}
